package net.magicalcloud.magicalcloud.execption;

/**
 * 自定义异常
 * Created by Pei on 2018/6/7.
 */

public class CloudExecption extends Exception {

    //错误代码，基本就是服务器返回的code
    private int Code;

    public CloudExecption() {
    }

    public CloudExecption(String detailMessage) {
        super(detailMessage);
    }

    public CloudExecption(String detailMessage, Throwable throwable) {
        super(detailMessage, throwable);
    }

    public CloudExecption(Throwable throwable) {
        super(throwable);
        this.Code = 9015;
    }

    public CloudExecption(int exceptionCode) {
        this.Code = exceptionCode;
    }

    public CloudExecption(int exceptionCode, String detailMessage) {
        super(detailMessage);
        this.Code = exceptionCode;
    }

    public CloudExecption(int exceptionCode, String detailMessage, Throwable throwable) {
        super(detailMessage, throwable);
        this.Code = exceptionCode;
    }

    public CloudExecption(int exceptionCode, Throwable throwable) {
        super(throwable);
        this.Code = exceptionCode;
    }

    public int getErrorCode() {
        return this.Code;
    }

    public String toString() {
        return "errorCode:" + this.Code + ",errorMsg:" + this.getMessage();
    }
}
